#ifndef RECOMMEND_H
#define RECOMMEND_H

#include <QNetworkAccessManager>
#include <QWidget>
#include <iostream>
#include "json/json.h"
#include <fstream>

struct rDishInfo
{
    int id;
    QString name;
    QString material;
    QString detail;
    QString pic;
    QString type;
    int userId;
    quint32 likeCount;
    quint32 commentCount;
};
namespace Ui {
class recommend;
}

class recommend : public QWidget
{
    Q_OBJECT

public:
    explicit recommend(QWidget *parent = nullptr);
    ~recommend();
    QNetworkAccessManager *accessManager;
    QNetworkRequest request;
    QByteArray postData;
    QNetworkReply* reply;
    QList<rDishInfo> rDishList;
    void GetDishList(QString token);
    void SearchDishList(QString name,int index,int size);
private slots:
    void on_pushButton_clicked();
    void finishedSlot(QNetworkReply *reply);
private:
    Ui::recommend *ui;

signals:
    void rgetDishListSuccess();
};

#endif // RECOMMEND_H
